8.python-bitcoinlibの利用
tag | slide |
---|---|
トップページ | 目次 |
HTTPクライアントさえあればBitcoin CoreのAPIを利用できるが、多くのプログラミング言語でAPI Clientのラッパーが提供されている。
今回はPythonのライブラリである python-bitcoinlib
を使用します。
$ git clone https://github.com/petertodd/python-bitcoinlib.git
サンプルプログラム
regtest
ネットで getblockchaininfo
の APIを叩いて、ブロック数を出力するプログラムです。
実行結果
$ python rpc-getblockchaininfo.py
102